<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>animate</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        div {
            width: 100px;
            height: 100px;
            background-color: orangered;
            position: absolute;
        }
    </style>
    <script src="./jquery-1.12.2.js"></script>
    <script>
        $(function () {
            var box = $('div')

            $('input').on('click', function () {
                box.animate({ //animate的第三个参数表示的是速度曲线,默认的是swing
                    left: 1300,
                    width: 600,
                    height: 300
                }, 2000, function () {
                    box.animate({
                        left: 1000,
                        width: 200,
                        height: 200,
                        top: 600
                    }, 2000, function () {
                        box.animate({
                            left: 20,
                            top: 600
                        }, 2000, function () {
                            box.animate({
                                left: 60,
                                top: 60,
                                width: 300,
                                height: 300
                            }, 5000)
                        })
                    })
                })
            })
        })
    </script>
</head>

<body>
    <input type="button" value="更改">
    <div></div>
</body>

</html>